#pragma once

#include <memory>
#include "stream/IOpenable.h"

namespace stream {

class Topic;

template<typename K, typename V>
class KvReader : public IOpenable {
public:
    typedef K key_type;
    typedef V value_type;
    typedef std::pair<key_type, value_type> record_type; //for ReaderWrapper 

    KvReader(std::shared_ptr<Topic> topic): _topic(topic){}
	virtual ~KvReader(){}
	
	virtual bool hasNext() const  = 0;
	virtual record_type current() const  = 0;
	virtual void next() = 0;

	virtual std::shared_ptr<Topic> topic() const{
        return _topic;
    }

private:
	std::shared_ptr<Topic> _topic;
};

}//end namespace stream
